/**
 * Created by tanbingqin on 2019/11/29.
 */
import config from 'config'
import httpFetch from 'share/httpFetch'

export default {
  //查询差标规则列表 查询用餐类型列表
  getRuleList(params, travelType) {
    if (travelType === 1010) {
      return httpFetch.get(`${config.baseUrl}/api/dining/scene/search`, params)
    } else {
      return httpFetch.get(`${config.baseUrl}/api/travel/rule/search`, params)
    }
  },

  //查询用餐的差标规则列表
  getDiningRuleList(params) {
    return httpFetch.get(`${config.baseUrl}/api/travel/rule/list/dining/scene`, params)
  },

  createRule(params) {
    return httpFetch.post(`${config.baseUrl}/api/travel/rule`, params)
  },

  saveRule(params) {
    return httpFetch.put(`${config.baseUrl}/api/travel/rule`, params)
  },

  //获取差标酒店配置
  getHotelConfig() {
    return httpFetch.get(`${config.baseUrl}/api/travel/rule/control/opt/tenant`)
  },

  saveHotelConfig(params) {
    return httpFetch.post(`${config.baseUrl}/api/travel/rule/control/opt`, params)
  },

  //获取城市级别
  getCityLevels(params) {
    return httpFetch.get(`${config.baseUrl}/api/levels/org?deleted=false&page=0&size=1000`, params)
  }

}
